IF Mui_RequestA(app, mui_main_win, 0, 'Warning!', '_Proceed|*_Cancel', 'A deep test may require the device to take itself offline temporarily\nor make temporary changes to the medium. It is highly recommended\nyou make sure nothing else is accessing the device before performing\nthis test.', NIL)<>0
IF Mui_RequestA(app, mui_main_win, 0, 'Warning!', '_Proceed|*_Cancel', 'A deep test may require the device to take itself offline temporarily\nor make temporary changes to the medium. It is highly recommended\nyou make sure nothing else is accessing the device before performing\nthis test.', NIL)<>0
Mui_RequestA(app, mui_main_win, 0, 'About Q-Device!','*_OK','\ecQ-Device! 0.5 by Ian Chapman (2003-2004)\nVersion 0.5 \n\nA low-level SCSI/IDE query, control and diagnostic tool\n\n\ebUse of this software is entirely at YOUR OWN risk!\en', NIL)
IF (track.adr_ctrl AND %00001000)=0 THEN outlist('\ebAudio Channels:\en', '2') ELSE outlist('\ebAudio Channels:\en', '4')
IF (track.adr_ctrl AND %00000001)=0 THEN outlist('\ebEmphasis:\en', 'Audio IS pre-emphasised') ELSE outlist('\ebEmphasis:\en', 'Audio NOT pre-emphasised')
ELSE
outlist('\ebTrack Type:\en', 'DATA')
ENDIF
IF (track.adr_ctrl AND %00000010)=0 THEN outlist('\ebCopyright:\en', 'Digital Copy Prohibited') ELSE outlist('\ebCopyright:\en', 'Digital Copy Permitted')
track:=track + SIZEOF toc_d
ENDFOR
ENDPROC
PROC process_atip(reply:PTR TO r_atip)
outlist_i('\ebATIP Data Length:\en', reply.atiplen, NIL)
outlist_i('\ebIndicitive Writing Power:\en', (reply.itwp AND %11110000), NIL)
outlist_i('\ebReference Speed:\en', (Char(reply+4) AND %00000111), NIL)
IF (reply.disctype AND %01000000) = 64 THEN outlist('\ebDisc Type:\en', 'CD-RW') ELSE outlist('\ebDisc Type:\en', 'CD-R')
outlist_i('\ebATIP Start Time of Lead-In',reply.startmin, ' minutes')
outlist_i('\ebATIP Start Time of Lead-In',reply.startsec, ' seconds')
outlist_i('\ebATIP Start Time of Lead-In',reply.startframe, ' frames')
outlist_i('\ebATIP Start Time of Lead-Out',reply.endmin, ' minutes')
outlist_i('\ebATIP Start Time of Lead-Out',reply.endsec, ' seconds')
outlist_i('\ebATIP Start Time of Lead-Out',reply.endframe, ' frames')
ENDPROC
/*
** This procedure handles the data returned from a request sense key query
*/
PROC process_sense(reply:PTR TO r_sense)
SELECT $F OF (reply.sensekey AND %00001111)
CASE $0
outlist_h('\ebSense Key:\en', 0, ' : No Specific Sense Key Info Available')
CASE $1
outlist_h('\ebSense Key:\en', 1, ' : Command recovered successfully from error')
CASE $2
outlist_h('\ebSense Key:\en', 2, ' : Unit is not ready for commands')
CASE $3
outlist_h('\ebSense Key:\en', 3, ' : Medium Error. The medium may contain errors or defects.')
** This procedure handles the data returned from a mode sense request
** (ie Device Parameters). It is quite complex because the data is in the form
** of many pages which have to be processed. In addition to that, a page type
** may have to be processed differently, or have a different meaning depending
** on the type of device queried. It's the master procedure for mode sense data
** and farms off the actual decoding to the specific page type handlers.
*/
PROC process_modesense(reply:PTR TO m_sense6, modesize)
DEF page:PTR TO CHAR, pagetype, reply2:PTR TO m_sense10, ptr:PTR TO CHAR,
datalen -> fh, out[100]:STRING
IF modesize=10
reply2:=reply
outlist_i('\ebMode Data Length:\en', reply2.datalen, ' bytes')
IF reply2.medium = 0 THEN outlist('\ebInserted Medium Type:\en','Default') ELSE outlist_i('\ebInserted Medium Type:\en', reply2.medium, ' (See supported media page)')
outlist_i('\ebDevice Specific Parameter:\en', reply2.devpar, NIL)
outlist_i('\ebDensity Code:\en', (Shr(reply2.blocks, 24) AND 255), NIL)
outlist_i('\ebNumber of Blocks:\en', (reply2.blocks AND $00FFFFFF),NIL)
outlist_i('\ebBlock Length:\en', (reply2.blocklen AND $00FFFFFF), ' bytes')
datalen:=reply2.datalen
IF reply2.desclen = 8 THEN page:=(reply2 + SIZEOF m_sense10) ELSE page:=(reply + 8)
ELSE
outlist_i('\ebMode Data Length:\en', reply.datalen, ' bytes')
IF reply.medium = 0 THEN outlist('\ebInserted Medium Type:\en', 'Default') ELSE outlist_i('\ebInserted Medium Type:\en', reply.medium, ' (See supported media page)')
outlist_i('\ebDevice Specific Parameter:\en', reply.devpar, NIL)
IF (Char(page+2) AND %00000100) = 4 THEN outlist('\ebAudio Completion Status:\en', 'On Audio Termination') ELSE outlist('\ebAudio Completion Status:\en', 'On Audio Playback')
IF (Char(page+2) AND %00000010) = 2 THEN outlist('\ebStop on Track Crossing:\en', 'When next track encountered') ELSE outlist('\ebStop on Track Crossing:\en', 'When transfer length satisfied')
outlist_i('\ebFormat of LBA/sec:\en', (Char(page+5) AND $00001111), NIL)
outlist_i('\ebLBA/sec per audio:\en', Int(page+6), NIL)
IF (Char(page+8) AND %10000000) = 128 THEN outlist('\ebData Buffer Recovery:\en', 'Enabled') ELSE outlist('\ebData Buffer Recovery:\en', 'Disabled or not supported')
IF (Char(page+8) AND %00100000) = 32 THEN outlist('\ebSetMarks:\en', 'Enabled') ELSE outlist('\ebSetMarks:\en', 'Disabled or not supported')
IF (Char(page+8) AND %00010000) = 16 THEN outlist('\ebAutomatic Velocity Control:\en', 'Yes') ELSE outlist('\ebAutomatic Velocity Control:\en', 'No')
IF (Char(page+8) AND %00000010) = 2 THEN outlist('\ebRecovery Buffer Order:\en', 'LIFO') ELSE outlist('\ebRecovery Buffer Order:\en', 'FIFO')
IF Char(page+9) = 0 THEN outlist('\ebGap Size:\en', 'Device Default') ELSE outlist_i('\ebGap Size:\en', Char(page+9), NIL)
IF Char(page+14) = 0
outlist('\ebCompression:\en', 'Disabled or not supported')
ELSEIF Char(page+14) = 1
outlist('\ebCompression:\en', 'Enabled')
ENDIF
ELSE
outlist('\ebInformation Page:\en', 'Unsupported or Reserved for this device class')